package top.yxqz.number3.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.yxqz.number3.entity.Emp;
import top.yxqz.number3.service.EmpService;

/**
 * @author: 余小小
 * @date: 2023/9/14
 * @description：
 */
@RestController
public class EmpController {

    @Autowired
    private EmpService service;

    /**
     * 需求：通过员工id获取员工信息
     *
     * @return
     */
    @GetMapping("/emp")
    public Emp getEmpById(@RequestParam("id") Integer id) {
        return service.getEmpById(id);
    }

}
